package com.example.treasure_back.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.SimpleFormatter;

@TableName("user_clock")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserClockModel {

    @TableId
    private String email;
    private Integer totalDays;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date today;
    private Integer isClock;

    @Override
    public String toString() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        return "UserClockModel{" +
                "email='" + email + '\'' +
                ", totalDays=" + totalDays +
                ", today=" + format.format(today) +
                ", isClock=" + isClock +
                '}';
    }
}
